{%- set v_root_engine = salt['pillar.get']('default:OMV_PROFTPD_MODVROOT_VROOTENGINE', 'on') -%}
{%- set v_root_log = salt['pillar.get']('default:OMV_PROFTPD_MODVROOT_VROOTLOG', '/var/log/proftpd/vroot.log') -%}
LoadModule mod_vroot.c
<IfModule mod_vroot.c>
  VRootEngine {{ v_root_engine }}
  VRootLog {{ v_root_log }}
{%- for share in config.shares.share -%}
{%- if share.enable | to_bool -%}
{%- set sfpath = salt['omv_conf.get_sharedfolder_path'](share.sharedfolderref) -%}
{%- set sfname = salt['omv_conf.get_sharedfolder_name'](share.sharedfolderref) %}
  VRootAlias "{{ sfpath }}" "/{{ sfname.rstrip('/') }}"
{%- endif -%}
{%- endfor %}
{%- if config.homesenable | to_bool and homedir_config.enable | to_bool -%}
{%- set sfpath = salt['omv_conf.get_sharedfolder_path'](homedir_config.sharedfolderref) %}
  VRootAlias "{{ sfpath.rstrip('/') }}/%u/" "/%u"
{%- endif %}
</IfModule>
